package com.ecommerce.dal.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ecommerce.dal.dao.impl.AdminDAO;
import com.ecommerce.dal.entity.Admin;
import com.ecommerce.dal.service.IAdminManagerService;

@Service("adminManagerService")
public class AdminManagerService implements IAdminManagerService {

	@Autowired
	AdminDAO adminDAO;
	@Override
	public Admin retrieveAdmin(long adminId) {
		return adminDAO.findByAdminId(adminId);
	}

	@Override
	public Admin retrieveAdmin(String userName, String password) {
		return adminDAO.findVerifiedAdmin(userName, password);
	}

	@Override
	public void saveAdmin(Admin admin) {
		adminDAO.save(admin);
		
	}

	@Override
	public void updateAdmin(Admin admin) {
		adminDAO.update(admin);
		
	}

	@Override
	public void deleteAdmin(Admin admin) {
		adminDAO.delete(admin);
		
	}

}
